
var num: number = 0;
// num = "1234";
num = 100;

let str: string = "tom";
// str = false;
str = "admin"

// let arr = [1,2,3,4];
// ==>
// let arr: number[] = [1, 2, 3, 4]
let arr: Array<number> = [1, 2, 3, 4]
// arr.push("aaaa")
arr.push(10)

// let names: string[] = ["a", "b", "c", "d"]
let names: Array<string> = ["a", "b", "c", "d"]
// names.push(10);
names.push("a")

// let arr2 = [1,"a",false]
let arr2: (number | string | boolean)[] = [1, "a", false]

// <数据类型> 泛型定义
let arr3: Array<number | string | boolean> = [1, "a", false]

// 元组
let arr4: [string,number,boolean] = ["a",123,false]

// any 表示任意类型
let arr5:Array<any> = [];
arr5.push(1)
arr5.push("asda")
arr5.push(false)
